package com.singzi.leetcode.N100;


import java.util.ArrayList;

public class T0073 {
}

class Solution0073{
    public void etZeroes(int[][] matrix) {
        ArrayList<int[]> list = new ArrayList<>();

        int m = matrix.length;
        int n = matrix[0].length;
        for(int i = 0;i < m; i++){
            for (int j = 0; j < n; j++) {
                if(matrix[i][j] == 0){
                    int[]temp = new int[2];
                    temp[0] = i;
                    temp[1] = j;
                    list.add(temp);
                }
            }
        }
        for (int[] ints : list) {
            for (int j = 0; j < n; j++) {
                matrix[ints[0]][j] = 0;
            }
            for (int k = 0; k < m; k++) {
                matrix[k][ints[1]] = 0;
            }

        }

    }
}
